﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Sauces.Bussinees.Entities.Compras;
using System.Data.Entity.ModelConfiguration;
using System.ComponentModel.DataAnnotations.Schema;

namespace Sauces.Repository.Mapping
{
   public class PedidoProveedorMap:EntityTypeConfiguration<PedidoProveedor>
    {
       public PedidoProveedorMap()
       {
           this.HasKey(t => t.Id);

           
           this.Property(p => p.Fecha).IsRequired();
           this.Property(p => p.Total).IsRequired();

           this.ToTable("PedidoProveedor");

           this.Property(p => p.Id).HasColumnName("IdPedidoProveedor");

           this.HasRequired(p => p.Proveedor).WithMany(p => p.PedidoProveedor).HasForeignKey(p => p.IdProveedor).WillCascadeOnDelete(false);
       }
    }
}
